import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const modulesFiles = require.context("./module", true, /\.js$/);
const modules = modulesFiles.keys().map(modulePath => {
  const value = modulesFiles(modulePath);
  return value.default;
});

const routes = modules;

const router = new VueRouter({
  routes
});

export default router;
